package com.ps.controller;


import com.ps.pojo.Premission;
import com.ps.service.PremissionService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Controller
public class IndexController {

    @Resource
    private PremissionService premissionService;

    @GetMapping("/index")
    public String index(Model model){
        Map<Premission, List<Premission>> map= premissionService.searchMenuList();
        model.addAttribute("map",map);
        return "index";
    }

    @RequestMapping("/welcome")
    public String welcome(){
        return "welcome";
    }
}
